#pragma once

#include "Tool.h"
#include "RubberRect.h"

class ZoomView;

class ZoomTool : public Tool
{
	DECLARE_DYNAMIC(ZoomTool)

public:
	ZoomTool(ZoomView & owner);

	enum ZoomState { none, in, out };

// Attributes
private:

	HCURSOR			m_CursorZoomIn;
	HCURSOR			m_CursorZoomOut;
	HCURSOR			m_CursorZoom;
	HCURSOR			m_CursorNoZoom;

	ZoomState		m_State;
	RubberRect		m_RubberRect;

	ZoomView &	m_Owner;

// Operations
public:
		 
	virtual void Show();
	virtual void Hide();

	void ZoomIn(CPoint p);
	void ZoomOut(CPoint p);
	void ZoomFit();
					   
	virtual void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void OnLButtonDown(UINT nFlags, CPoint p);
	virtual void OnLButtonUp(UINT nFlags, CPoint p);
	virtual void OnMouseMove(UINT nFlags, CPoint p);
	virtual void OnRButtonDown(UINT nFlags, CPoint p);
	virtual void OnRButtonUp(UINT nFlags, CPoint p);
	virtual bool OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(ZoomTool)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~ZoomTool();

	// Generated message map functions
	//{{AFX_MSG(ZoomTool)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
